<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<base th:href="${#request.getContextPath()+'/'}">
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,goods-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="layui/css/layui.css"  media="all">
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="h-ui.admin/css/style.css" />
<link rel="stylesheet" type="text/css" href="lib/webuploader/0.1.5/webuploader.css">
<!--<link rel="stylesheet" type="text/css" href="webuploader/style.css">-->

<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />

<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<title>添加商品 - H-ui.admin v3.1</title>
<meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">

<style type="text/css">
	#province select{margin-right:20px; width:100px;height: 30px}
</style>

</head>
<body>
<article class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-goods-add">
		<div class="row cl">
			<label class="form-label col-3 col-sm-3"><span class="c-red">*</span>商品名称：</label>
			<div class="formControls col-5 col-sm-6">
				<input type="text" class="input-text" value="" placeholder="" id="goodsName" name="goodsName"  errormsg="" datatype="*"  nullmsg="商品名不能为空">
			</div>
			<div class="col-4 col-sm-3"></div>
		</div>
		<div class="row cl">
			<label class="form-label col-3 col-sm-3"><span class="c-red">*</span>商品类型：</label>
			<div class="formControls col-5 col-sm-6">
				<span class="select-box">
					<select class="select" size="1" id="goodsType" name="goodsType" datatype="*" nullmsg="请选择商品类型">

						<option value="" selected>请选择类型</option>
						<option value="1">家具类</option>
						<option value="2">服装类</option>
						<option value="3">日常类</option>
					</select>
				</span>
			</div>
			<div class="col-4 col-sm-3"></div>
		</div>
		<div class="row cl">
			<label class="form-label col-3 col-sm-3"><span class="c-red">*</span>商品价格：</label>
			<div class="formControls col-5 col-sm-6">
				<input type="text" class="input-text" value="" placeholder="" id="goodsPrice" name="goodsPrice"  errormsg="请输入正确的价格" datatype="/^\d+(\.\d{1,2})?$/"  nullmsg="商品价格不能为空">
			</div>
            <div class="col-4 col-sm-3"></div>
		</div>
		<div class="row cl">
			<label class="form-label col-3 col-sm-3"><span class="c-red">*</span>商品库存：</label>
			<div class="formControls col-5 col-sm-6">
				<input type="text" class="input-text" value="" placeholder="" id="goodsStock" name="goodsStock"  errormsg="库存为正整数" datatype="n"  nullmsg="商品库存不能为空">
			</div>
			<div class="col-4 col-sm-3"></div>
		</div>
		<div class="row cl">
			<label class="form-label col-3 col-sm-3"><span class="c-red">*</span>商品图片：</label>
			<input type="hidden" name="goodsPic" id="goodsPic" value="">
			<div class="formControls col-5 col-sm-6">
					<div class="uploader-list-container">
					<div class="queueList">
						<div id="dndArea" class="placeholder">
							<div id="filePicker-2"></div>
							<p>或将照片拖到这里，单次最多可选300张</p>
						</div>
					</div>
					<div class="statusBar" style="display:none;">
						<div class="progress"> <span class="text">0%</span> <span class="percentage"></span> </div>
						<div class="info"></div>
						<div class="btns">
							<div id="filePicker2"></div>
							<div class="uploadBtn">开始上传</div>
						</div>
					</div>
				</div>
			</div>
			<div class="col-4 col-sm-3"></div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-3">商品描述：</label>
			<div class="formControls col-xs-5 col-sm-6">
				<textarea name="goodsDesc" cols="" rows="" class="textarea"  placeholder="输入商品描述"></textarea>
			</div>
			<div class="col-4 col-sm-3"></div>
		</div>

		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>


<script type="text/javascript" src="h-ui/js/H-ui.js"></script>



<script type="text/javascript" src="lib/jquery/provincesData.js"></script>
<script type="text/javascript" src="lib/jquery/jquery.provincesCity.js"></script>
<script type="text/javascript" src="h-ui/js/submit_form_register.js"></script>
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.js"></script>
<script type="text/javascript" src="lib/webuploader/0.1.5/image-upload/upload.js"></script>

<script type="text/javascript">
$(function() {


    $("#form-goods-add").Validform({
        tiptype:2
        ,callback:function(form){ // 表单校验通过后调用这个函数
			console.info("表单校验通过");
			var goodsImg=$("#goodsPic").val();
			if (!goodsImg) {
				alert("请先上传图片");
				return false;
			}
            submitForm("goods/addGoods","form-goods-add")
            // 如果callback里明确return false，则表单不会提交，如果return true或没有return，则会提交表单
            return false;


        }
    });
});
</script> 

</body>
</html>